﻿@inherits System.Web.Mvc.WebViewPage<Pikapika.Models.Novel>

@{
	ViewBag.Title = "Novel - Edit - " + Model.Name;
	
}

	@using (Html.BeginForm()) {
		@Html.ValidationSummary(true)
		
		<fieldset>
			<legend>Fields</legend>
			
			<div class="editor-label">
				@Html.LabelFor(model => model.Id)
			</div>
			<div class="editor-field">
				@Model.Id
			</div>
			
			<div class="editor-label">
				@Html.LabelFor(model => model.Name)
			</div>
			<div class="editor-field">
				@Html.TextBoxFor(model => model.Name)
				@Html.ValidationMessageFor(model => model.Name)
			</div>
			
			<div class="editor-label">
				@Html.LabelFor(model => model.Description)
			</div>
			<div class="editor-field">
				@Html.TextAreaFor(model => model.Description)
				@Html.ValidationMessageFor(model => model.Description)
			</div>
			
			<div class="editor-label">
				@Html.LabelFor(model => model.PublisherId)
			</div>
			<div class="editor-field">
				@Html.DropDownListFor(model => model.PublisherId, new SelectList((IEnumerable)ViewBag.AllPublishers.Value, "Id", "Name", Model.PublisherId), " --- Publishers --- ")
				@Html.ValidationMessageFor(model => model.PublisherId)
			</div>
			
			<div class="editor-label">
				@Html.LabelFor(model => model.Author)
			</div>
			<div class="editor-field">
				@Html.TextBoxFor(model => model.Author)
				@Html.ValidationMessageFor(model => model.Author)
			</div>
			
			<div class="editor-label">
				@Html.LabelFor(model => model.ImageUrl)
			</div>
			<div class="editor-field">
				@Html.TextBoxFor(model => model.ImageUrl, new { id = "image-url" })
				@Html.ValidationMessageFor(model => model.ImageUrl)
			</div>
			
			<div class="editor-label">
				@Html.LabelFor(model => model.RatingPoints)
			</div>
			<div class="editor-field">
				@Html.TextBoxFor(model => model.RatingPoints)
				@Html.ValidationMessageFor(model => model.RatingPoints)
			</div>
			
			<div class="editor-label">
				@Html.LabelFor(model => model.RatingCount)
			</div>
			<div class="editor-field">
				@Html.TextBoxFor(model => model.RatingCount)
				@Html.ValidationMessageFor(model => model.RatingCount)
			</div>
			
			<div class="editor-label">
				@Html.LabelFor(model => model.UpdatedDate)
			</div>
			<div class="editor-field">
				@Html.TextBoxFor(model => model.UpdatedDate)
				@Html.ValidationMessageFor(model => model.UpdatedDate)
			</div>
			
			<p>
				<input type="submit" value="Save" />
			</p>
		</fieldset>

	}

	<div>
		@Html.ActionLink("Back to List", "Index", new { publisherId = Model.Publisher.Id })
	</div>


	
@section Head {
	@Html.Partial("_ImageUploader", "#image-url")
}